<template>
    <div class="layout-logined" :route="routename">
        <Headerbar :class="{unlogin: !isLogin}" />

        <div class="layout-content" v-if="isLogin">
            <Nuxt class="layout-page" />
        </div>

        <FooterMap v-if="routename == 'distributor' && isLogin" />

        <Login :force="true" />

        <!-- 移动端禁用界面 -->
        <WapForbid />

    </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
    data () {
        return {
        };
    },
    computed: {
        ...mapGetters({
            isLogin: "getIsLogin",
        }),
        routename () {
            return this.$route.name || '';
        },
        model () {
            const path = this.$route.path || '';
            const match = path.match(/\w+/) || [];
            return match[0] || ''
        },
        forbid () {
            const path = this.$route.path || '';
            // const name = path.replace(/\/(\w+)(\/[\W\w]*)?/, '$1')
            return path != '/user'
        },
    },

    methods: {
    },
    created () {
    },
    mounted () {
    },
};
</script>
<style lang="scss" scoped>
.layout-header {
    height: 60px !important;

    &::v-deep {
        .header {
            padding: 0 24px;
            height: 60px;

            .header-logo img {
                width: 120px;
                height: 22px;
                image-rendering: -moz-crisp-edges;
                image-rendering: -o-crisp-edges;
                image-rendering: -webkit-optimize-contrast;
                image-rendering: crisp-edges;
                -ms-interpolation-mode: nearest-neighbor;
            }
            .header-nav ul {
                display: none;
            }
        }
    }

    &.unlogin::v-deep {
        .header {
            background: none;
            border-color: transparent;
            .header-currency,
            .header-login {
                display: none;
            }
        }
    }
}

.layout-content {
    padding: 0 24px;
    min-height: calc(100vh - 60px);
    box-sizing: border-box;
}

.layout-logined {
    &[route='order-product'],
    &[route='order-shipping'],
    &[route='order-confirm'] {
        background-color: #f8f8f8;
    }
}
</style>
